package com.bootdo.program.wallpaper.controller;

import java.util.List;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bootdo.program.wallpaper.domain.BzDeductionRecordDO;
import com.bootdo.program.wallpaper.service.BzDeductionRecordService;
import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.Query;
import com.bootdo.common.utils.R;

/**
 * 扣量记录表
 * 
 * @author guoyunfei
 * @email 2549789059@qq.com
 * @date 2022-03-01 10:41:27
 */
 
@Controller
@RequestMapping("/wallpaper/bzDeductionRecord")
public class BzDeductionRecordController {
	@Autowired
	private BzDeductionRecordService bzDeductionRecordService;
	
	@GetMapping()
	@RequiresPermissions("wallpaper:bzDeductionRecord:bzDeductionRecord")
	String BzDeductionRecord(){
	    return "wallpaper/bzDeductionRecord/bzDeductionRecord";
	}
	
	@ResponseBody
	@GetMapping("/list")
	@RequiresPermissions("wallpaper:bzDeductionRecord:bzDeductionRecord")
	public PageUtils list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);
		List<BzDeductionRecordDO> bzDeductionRecordList = bzDeductionRecordService.list(query);
		int total = bzDeductionRecordService.count(query);
		PageUtils pageUtils = new PageUtils(bzDeductionRecordList, total);
		return pageUtils;
	}

}
